import React from 'react';
import useAccess from '../useAccess';
export default (props) => {
  const { accessible, children, fallback } = props
  const { checkActionAccess } = useAccess()
  if (checkActionAccess(accessible)) {
    return children
  }
  return fallback ? fallback : null
}